﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Collections.Generic;

namespace AIC_CS
{
    public partial class PhuLuc_Edit : MyFromBase
    {
        public static string SelectedPhuLuc = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
                //UserControl u1 = (UserControl)LoadControl("MainReport_View.ascx");
                //divPhuLucControls.Controls.Add(u1);
                //SelectedPhuLuc = MyReportFullName;
                BindDataToControls();
            //}

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void BindDataToControls()
        {
            // lbl_baocaoso.Text = (lstDauVao.SelectedIndex ).ToString();
            //string tt= lstDauVao.SelectedItem.Text;
            divPhuLucControls.Controls.Clear();
            if (MyReportFullName == "Báo cáo chính")
            {
                UserControl u1 = (UserControl)LoadControl("MainReport_View.ascx");
                divPhuLucControls.Controls.Add(u1);
                lbl_baocaoso.Text = "Báo cáo chính";
            }
            else
            {
                if (MyReportFullName == "Phụ lục 1")
                {
                    UserControl u1 = (UserControl)LoadControl("phuluc1.ascx");
                    divPhuLucControls.Controls.Add(u1);
                    lbl_baocaoso.Text = "Phụ lục 1";

                }
                else
                {
                    if (MyReportFullName == "Phụ lục 2")
                    {
                        UserControl u1 = (UserControl)LoadControl("phuluc2.ascx");
                        divPhuLucControls.Controls.Add(u1);
                        lbl_baocaoso.Text = "Phụ lục 2";

                    }
                    else
                    {
                        if (MyReportFullName == "Phụ lục 3")
                        {
                            UserControl u1 = (UserControl)LoadControl("phuluc3.ascx");
                            divPhuLucControls.Controls.Add(u1);
                        }
                        else
                        {
                            if (MyReportFullName == "Phụ lục 4")
                            {
                                UserControl u1 = (UserControl)LoadControl("phuluc4.ascx");
                                divPhuLucControls.Controls.Add(u1);
                            }
                            else
                            {
                                if (MyReportFullName == "Phụ lục 5")
                                {
                                    UserControl u1 = (UserControl)LoadControl("phuluc5.ascx");
                                    divPhuLucControls.Controls.Add(u1);
                                }
                                else
                                {
                                    if (MyReportFullName == "Phụ lục 6")
                                    {
                                        UserControl u1 = (UserControl)LoadControl("phuluc6.ascx");
                                        divPhuLucControls.Controls.Add(u1);
                                    }
                                    else
                                    {
                                        if (MyReportFullName == "Phụ lục 7")
                                        {
                                            UserControl u1 = (UserControl)LoadControl("phuluc7.ascx");
                                            divPhuLucControls.Controls.Add(u1);
                                        }
                                        else
                                        {
                                            UserControl u1 = (UserControl)LoadControl("phuluc8.ascx");
                                            divPhuLucControls.Controls.Add(u1);
                                        }
                                    }
                                }
                            }
                        }
                    }

                }
            }
        }
        //private void BindDataToControls()
        //{
        //    //string sql = "Select ID,TenDM From tblDanhMuc Where MaDM='" + MyConst.DanhMuc.PhuLucBaoCaoCT_CS.Ma + "' ";
        //    //SqlDataReader myReader = SqlHelper.ExecuteReader(CommandType.Text, sql);
        //    //lstDauVao.Items.Clear();
        //    //string text_="Báo cáo chính";
        //    //string value_="51";
        //    //lstDauVao.Items.Add(new ListItem(text_,value_));
        //    //while (myReader.Read())
        //    //{
        //    //    lstDauVao.Items.Add(new ListItem(myReader["TenDM"].ToString(), myReader["ID"].ToString()));
        //    //}

        //}

        //protected void lstDauVao_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    SelectedPhuLuc = lstDauVao.SelectedItem.Text;
        //    if (lstDauVao.SelectedItem.Text=="Báo cáo chính")
        //        lbl_baocaoso.Text = "Báo cáo chính";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 1")
        //        lbl_baocaoso.Text = "1";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 2")
        //        lbl_baocaoso.Text = "2";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 3")
        //        lbl_baocaoso.Text = "3";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 4")
        //        lbl_baocaoso.Text = "4";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 5")
        //        lbl_baocaoso.Text = "5";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 6")
        //        lbl_baocaoso.Text = "6";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 7")
        //        lbl_baocaoso.Text = "7";
        //    if (lstDauVao.SelectedItem.Text == "Phụ lục 8")
        //        lbl_baocaoso.Text = "8";
        //}
    }
}
